﻿using System;
using System.IO;
using System.Xml;
using System.Configuration;
using System.Web;
using SyCODE.Component.DataFactory;
using System.Collections.Specialized;
using SyCODE.Component.Security;
using SyCODE.Component;
using System.Web.Security;

/// <summary>
/// SyCODE 的摘要说明
/// </summary>
namespace SyCODE.Blog
{
    public class SetTheme : IHttpHandler
    {        public bool IsReusable
        {
            get { return true; }
        }

        public void ProcessRequest(HttpContext context)
        {
			Ticket ticket = Ticket.Get(FormsAuthentication.FormsCookieName);
            if (Ticket.Authenticate(ticket))
            {
                Updater.Theme updater = new SyCODE.Blog.Updater.Theme(ticket.Name);
                updater.Set(context.Request.Form["theme"], context.Request.Form["skin"]);
                updater.Dispose();
            }
            else
            {
                Function.ClientAlert(StringResource.GetField("authfaild"));
            }
        }
    }
}